<!doctype html>
<html lang="zn-en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="__STATIC__/index/lib/css/bootstrap.css"  crossorigin="anonymous">
    <link rel="stylesheet" href="__STATIC__/index/css/index.css">
    <link href="__STATIC__/layui/css/layui.css" rel="stylesheet">
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"  crossorigin="anonymous"></script>
    <script src="__STATIC__/index/lib/js/bootstrap.bundle.js" crossorigin="anonymous"></script>
    <script src="__STATIC__/index/lib/js/bootstrap.js"  crossorigin="anonymous"></script>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script type="text/javascript" src="__STATIC__/layui/layui.all.js"></script>
    <title>首页</title>
</head>
<body>
<header class="header">
    <div class="logo">
        <div class="btitle d-inline-block p-1 pb-1">
            <img src="__STATIC__/index/images/logo.png" alt="">
        </div>
        <div class="login">
            <i class="iconfont">&#xe7a5;</i>
            {if empty(session('user_id')) }
            <a href="{:url('index/login/login')}">登录</a>/<a href="{:url('index/login/reg')}">注册</a>
            {else /}
            <a href="{:url('index/center/index')}">个人中心</a>/ <a id="layout">退出</a>
            {/if}

        </div>
    </div>

</header>
<nav>
    <ul>
        <li >
            <a class="" href="{:url('index/index/index')}">首页</a>
        </li>
        <li >
            <a class="" href="{:url('index/article/index')}">动态咨询</a>
        </li>
        <li >
            <a class="" href="{:url('index/project/index')}">视频课程</a>
        </li>
        <li >
            <a class="" href="{:url('index/live/index')}">在线直播</a>
        </li>
        <li>
            <a class="" href="{:url('index/book/index')}">图书商城</a>
        </li>
        <li>
            <a class="" href="{:url('index/othvideo/index')}">短视频专区</a>
        </li>
    </ul>
</nav>
<div class="main-content">
{block name='content'}{/block}
</div>
<footer>
    <div class="copyright">
        Copyright © 2010-2020 MHK国语在线推广学习平台 All Rights Reserved<br>
        陕ICP备19016245号-1
    </div>
</footer>


<script>
    layui.use('layer', function(){
        var layer = layui.layer;
    });
    $('#layout').click(function () {
            $.post("{:url('index/login/layout')}","",function (res) {
                if(res.code){
                    layer.msg("退出成功",{icon:1});
                    setTimeout(function () {
                        window.location.href="{:url('index/index/index')}"
                    },500)
                }else {
                    layer.msg(res.msg,{icon:2});
                }
            })
    })
</script>
</body>
</html>